package com.capgemini.export.service;

import java.util.List;

import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.capgemini.excel.util.ExcelExportUtil;
import com.capgemini.export.mapper.LogisticsMapper;
import com.capgemini.export.pojo.LogisticsDataDto;
import com.capgemini.export.pojo.LogisticsQueryDto;

@Service
@Transactional
public class LogisticsService {
	public final Logger log = LoggerFactory.getLogger(this.getClass());

	@Autowired
	private LogisticsMapper logisticMapper;

	public List<LogisticsDataDto> queryLogisticsData(LogisticsQueryDto queryDto) {
		return logisticMapper.queryLogisticsData(queryDto);
	}

	public SXSSFWorkbook generateExcel(List<List<String>> content, List<String> header) {
		return ExcelExportUtil.generateExcel(content, header);
	}
}
